package com.zoe.vhr.service.impl;

import cn.hutool.core.date.DateUtil;
import com.zoe.vhr.mapper.PositionMapper;
import com.zoe.vhr.model.Position;
import com.zoe.vhr.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Zoe.Zhang
 * @Date: 2021/08/01
 * @Description
 */
@Service
public class PositionServiceImpl implements PositionService {
    @Autowired
    PositionMapper positionMapper;

    @Override
    public List<Position> listPositions() {
        return positionMapper.listPositions();
    }

    @Override
    public int savePosition(Position position) {
        position.setCreatedate(DateUtil.date());
        position.setEnabled(true);
        return positionMapper.savePosition(position);
    }

    @Override
    public int updatePosition(Position position) {
        return positionMapper.updatePosition(position);
    }

    @Override
    public int deletePosition(Integer id) {
        return positionMapper.deletePosition(id);
    }

    @Override
    public int deleteBatchPosition(List<Integer> ids) {
        return positionMapper.deleteBatchPosition(ids);
    }
}
